import 'package:get/get.dart';
import 'package:smart_devices/form/device_add_form.dart';
import 'package:smart_devices/model/department.dart';
import 'package:smart_devices/model/user.dart';
import 'package:smart_devices/params/device.dart';

class DeviceDetailsLogic extends GetxController {
  late Rx<DeviceAddForm> details;

  @override
  void onInit() {
    super.onInit();
    DeviceAddForm form = DeviceAddForm();
    form.code = 'SB005';
    form.name = '电梯设备0024';
    form.standards = '30*50*1';
    form.type = DeviceTypeEnum.scrap;
    form.location = '生产车间二层';
    form.remark = '需要安全存放设备';
    form.status = DeviceStatusEnum.run;
    form.department = DepartmentModel(deptId: 1, name: '生产部');
    form.user = UserModel(avatar: 'avatar', name: '李向明');
    form.mobile = '15762509079';
    form.startDate = '2023-02-18';
    form.power = '15000';
    form.oderNo = 'SB101815978';
    form.supplier = '供应商一';
    form.buyDept = DepartmentModel(deptId: 2, name: '技术部');
    form.buyUser = UserModel(avatar: 'avatar', name: '陈明霞');
    form.buyDate = '2023-04-12';
    form.leaveFactoryDate = '2023-03-15';
    form.manufacturer = '厂商一';
    form.life = '5';
    form.price = 7852.35;
    details = Rx(form);
  }
}
